

CREATE TABLE [ItemCategoryLink] (
    [ItemCategoryLinkID] integer PRIMARY KEY AUTOINCREMENT  NOT NULL ,
    [ItemID] integer   NOT NULL ,
    [CategoryID] integer   NOT NULL
);



CREATE TABLE [Config] (
    [ConfigID] integer PRIMARY KEY AUTOINCREMENT  NOT NULL ,
    [ConfigName] nvarchar(100)   NOT NULL ,
    [ConfigValue] nvarchar(100)   NOT NULL ,
    [ConfigValueType] nvarchar(100)   NOT NULL
);

CREATE TABLE [RememberHistory] (
    [HistoryID] integer PRIMARY KEY AUTOINCREMENT  NOT NULL ,
    [ItemID] integer   NOT NULL ,
    [Book] integer   NULL ,
    [ItemOrder] integer   NOT NULL ,
    [Difficulty] integer   NOT NULL ,
    [Importance] integer   NOT NULL ,
    [ShowFlow] nvarchar(50)   NULL ,
    [LoginID] nvarchar(50)   NULL ,
    [StartDate] datetime   NULL ,
    [StartResult] integer   NOT NULL ,
    [LastDate] datetime   NULL ,
    [LastResult] integer   NOT NULL ,
    [NextDate] datetime   NULL ,
    [StopDate] datetime   NULL ,
    [IsActivted] bit   NOT NULL ,
    [CurveIndex] integer   NOT NULL ,
    [RepeatCount] integer   NOT NULL ,
    [ResultA] integer   NOT NULL ,
    [ResultB] integer   NOT NULL ,
    [ResultC] integer   NOT NULL ,
    [ResultD] integer   NOT NULL
);

CREATE TABLE [CategoryList] (
    [CategoryID] integer PRIMARY KEY AUTOINCREMENT  NOT NULL ,
    [CategoryStatus] integer   NOT NULL ,
    [CategoryNumber] nvarchar(50)   NOT NULL ,
    [CategoryName] nvarchar(500)   NOT NULL ,
    [CategoryDesc] nvarchar(500)   NULL ,
    [CategoryText] nvarchar(500)   NULL ,
    [CategorySound] nvarchar(50)   NULL ,
    [ParentID] integer   NULL ,
    [CategoryLevel] integer   NULL ,
    [CategoryIndex] integer   NULL ,
    [ItemTotal] integer   NULL ,
    [ItemDone] integer   NULL ,
    [ItemPlan] integer   NULL ,
    [ItemDrill] integer   NULL ,
    [FrequentlyIndex] integer   NULL
);

CREATE TABLE [RememberItem] (
    [ItemID] integer PRIMARY KEY AUTOINCREMENT  NOT NULL ,
    [Book] integer   NULL ,
    [Category] integer   NULL ,
    [ItemStatus] integer   NOT NULL ,
    [ItemOrder] integer   NOT NULL ,
    [ItemName] nvarchar(50)   NULL ,
    [ItemType] nvarchar(50)   NULL ,
    [ItemQuestion] nvarchar(500)   NOT NULL ,
    [ItemAnswer] nvarchar(500)   NOT NULL ,
    [ItemPicture] nvarchar(500)   NULL ,
    [ItemSound] nvarchar(200)   NULL ,
    [ItemVideo] nvarchar(200)   NULL ,
    [ItemDesc] nvarchar(2000)   NULL ,
    [ItemRelation] nvarchar(2000)   NULL ,
    [ItemSource] nvarchar(2000)   NULL ,
    [ItemFlow] nvarchar(50)   NULL
);

CREATE TABLE [MyBook] (
    [MyBookID] uniqueidentifier   NOT NULL ,
    [CategoryID] integer   NOT NULL ,
    [ItemDone] integer   NOT NULL ,
    [ItemDrill] integer   NOT NULL ,
    [PlanUnit] integer   NOT NULL ,
    [PlanTotal] integer   NOT NULL ,
    [LoginID] nvarchar(50)   NOT NULL ,
    [Status] integer   NOT NULL ,
    [StartDate] datetime   NULL ,
    [LastDate] datetime   NULL ,
    [TodayStatus] integer   NOT NULL ,
    [TodayFlow] nvarchar(20)   NOT NULL ,
    [PrevCategory] integer   NULL ,
    [NextCategory] integer   NULL ,
    [OrderNumber] integer   NOT NULL
);

CREATE TABLE [Login] (
    [LoginID] nvarchar(36)   NOT NULL ,
    [Number] integer   NOT NULL ,
    [LoginName] nvarchar(50)   NOT NULL ,
    [LoginPassword] nvarchar(100)   NOT NULL ,
    [RememberMe] integer   NOT NULL ,
    [RegisterDate] datetime   NULL ,
    [LastLoginDate] datetime   NULL ,
    [Status] integer   NOT NULL ,
    [LoginDesc] nvarchar(50)   NULL ,
    [LoingParent] nvarchar(50)   NULL
);

CREATE TABLE [EZMemoToday] (
    [TodayID] integer PRIMARY KEY AUTOINCREMENT  NOT NULL ,
    [ItemID] integer   NOT NULL ,
    [TodayDate] nvarchar(50)   NULL ,
    [CheckResult] nvarchar(50)   NULL ,
    [LoginID] nvarchar(50)   NULL ,
    [CheckType] nvarchar(50)   NULL
);

